package com.example.forum.mapper;

import com.example.forum.entity.ArticleReply;
import com.example.forum.vo.ArticleReplyVO;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * @author lyk19
 * @description 针对表【t_article_reply】的数据库操作Mapper
 * @createDate 2024-08-01 12:54:53
 * @Entity generator.domain.TArticleReply
 */

@Mapper
public interface ArticleReplyMapper {

    /**
     * 创建回复
     *
     * @param articleReply
     */
    @Insert("insert into t_article_reply(articleId, postUserId, replyId, replyUserId, content, likeCount, state, deleteState, createTime, updateTime) "
            + "values(#{articleId}, #{postUserId}, #{replyId}, #{replyUserId}, #{content}, #{likeCount}, #{state}, #{deleteState}, #{createTime}, #{updateTime})")
    void create(ArticleReply articleReply);

    /**
     * 获取回复列表
     *
     * @param articleId
     * @return
     */
    List<ArticleReplyVO> getReplyList(Long articleId);

}
